package cn.zzp.ggkt.vod.controller;

import cn.zzp.ggkt.result.Result;
import org.springframework.web.bind.annotation.*;

import java.util.HashMap;

/**
 * @ClassName UserLoginController
 * @Description 后台管理人员登录
 * @Author 祝志鹏
 * @Date 2022/8/22 21:07
 */
@RestController
@CrossOrigin
@RequestMapping("/admin/vod/user")
public class UserLoginController {

    @PostMapping("login")
    public Result login(){

        // {"code":20000,"data":{"token":"admin-token"}}
        HashMap<String, Object> map = new HashMap<>();
        map.put("token","admin-token");

        return Result.ok(map);

    }

    @GetMapping("/info")
    public Result info(){
        //{"code":20000,"data":
        // {"roles":["admin"],
        // "introduction":"I am a super administrator",
        // "avatar":"https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif",
        // "name":"Super Admin"}}
        HashMap<String, Object> map = new HashMap<>();

        map.put("roles","admin");
        map.put("introduction","I am a super administrator");
        map.put("avatar", "https://wpimg.wallstcn.com/f778738c-e4f8-4870-b634-56703b4acafe.gif");
        map.put("name", "Super admin");

        return Result.ok(map);
    }

}
